<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title>Document</title>
	<style>
	</style>
</head>

<body>
	<div id="content" style="height:150px;line-height:150px;text-align:center; color: #fff;background-color:#ccc;font-size:80px;"></div>
	<script>
		function debounce(func, wait) {
			var timeout;

			return function () {
				var context = this;
				var args = arguments;
				console.log(args)
				console.log(func)
				if (timeout) clearTimeout(timeout);

				timeout = setTimeout(function () {
					func.apply(context, args)
				}, wait);
			}
		}

		var num = 1;
		var content = document.getElementById('content');

		function count() {
			content.innerHTML = num++;
		};

		content.onmousemove = debounce(count,1000);;
	</script>

</body>

</html>